UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7QVyKD/fycXQ7os7b82svDujqYRLkXJHClRmYMxxaek='
WHERE
key_id = '2bd7e6c6cd96bcfb9c4316241690af935981c0a1c0a8a92a1ce8afc7b115f4dd'
AND (
token = '7QVyKD/fycXQ7os7b82svDujqYRLkXJHClRmYMxxaek='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)