UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E63aBBQ1WB+9P7ULocSAst7rZoxNWRC0XUsw8qHea9Q='
WHERE
key_id = 'e623becd20417dd803160180273b64cb1a5c01549161da618e57ce2023bfb923'
AND (
token = 'E63aBBQ1WB+9P7ULocSAst7rZoxNWRC0XUsw8qHea9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)