UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MweBcBaAbdmsRiC+oMT2NsSSG7mR4du+jbTi3Pb+s5k='
WHERE
key_id = '13abac8b1ddb8e5ad6c9f37182a2251a34619dc1b0587baf5822cfed5cd46557'
AND (
token = 'MweBcBaAbdmsRiC+oMT2NsSSG7mR4du+jbTi3Pb+s5k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)