UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hwd1eANJcLz+nbxhTfYnmVMwDj8s/FkKpgcqyib7QNA='
WHERE
key_id = '6742c15aceffd2fffaa8d6def8e23cd1613e075aea9a70753e21841510cff22a'
AND (
token = 'hwd1eANJcLz+nbxhTfYnmVMwDj8s/FkKpgcqyib7QNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)