UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hGuC169+GRb8KgT0Q8vAVOJrmKEi7zg6a9kDZkbdnaI='
WHERE
key_id = '85aeea078b3437eee998fd5ba17a25128e0c926256f35960ca1c8209aff146da'
AND (
token = 'hGuC169+GRb8KgT0Q8vAVOJrmKEi7zg6a9kDZkbdnaI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)