UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f8AQJckh8ER8XsydTPTo6jLc19v2OasMA/bpqZ8vtUc='
WHERE
key_id = 'ea8df303a15a3a565bbe34f958fca47647038ff1d6d4bd58700ef87292060264'
AND (
token = 'f8AQJckh8ER8XsydTPTo6jLc19v2OasMA/bpqZ8vtUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)