UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JRHSyJ5NO0x7IT1wtgASvz9pA99CgydQMRUGrvbcbzk='
WHERE
key_id = '096d7518acae36199030c8fc971dd00cb7444b28886335586c48979ef1731915'
AND (
token = 'JRHSyJ5NO0x7IT1wtgASvz9pA99CgydQMRUGrvbcbzk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)