UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QXhc/F0PSpoMpAXEHnf8tZT7FCKywxHOwlCCjdeGLQY='
WHERE
key_id = '2291b1bbc93f3de5616edbee61fae64b845320e280eabc6157cc1650d4f78d98'
AND (
token = 'QXhc/F0PSpoMpAXEHnf8tZT7FCKywxHOwlCCjdeGLQY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)