UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6NhiE6m48iH4VumlqRC/8dm5GoMFl9H96F9YgOb1Du4='
WHERE
key_id = '8cab0fb2898461878e7d3a543bb9c8531c6162d6f22a48dac0b5c209225d27db'
AND (
token = '6NhiE6m48iH4VumlqRC/8dm5GoMFl9H96F9YgOb1Du4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)