UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PbYqPJTzg1EMTM9YkI27XlI2fUPs81zeWYIjR5AVhNk='
WHERE
key_id = '68594aac4cd83f29480e033f8166c07031b462580ada5d5bd087b466dba4fa73'
AND (
token = 'PbYqPJTzg1EMTM9YkI27XlI2fUPs81zeWYIjR5AVhNk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)