UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wfedZr3ikoy7wjkUbJiuexOg1R22GMAELi0CqIX3q6Y='
WHERE
key_id = 'dfb350bd0580711d54263ff1ac206b68e1119eb7b2601589c05bfd0ea162c754'
AND (
token = 'wfedZr3ikoy7wjkUbJiuexOg1R22GMAELi0CqIX3q6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)