UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eIpXT2IUsARsnlsTEqvRvuh+EyETyvp9xufWleLZo6g='
WHERE
key_id = '2866a0ea847f33b89943a580a9e005de11a60f1be47a80bdc224bdc26bcd24dd'
AND (
token = 'eIpXT2IUsARsnlsTEqvRvuh+EyETyvp9xufWleLZo6g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)