UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zYSR6/1dyQsOIGclqQjI+pd9z0eF1QsDskx5SMVlYeU='
WHERE
key_id = '435a86cf158b58c543d915c4de13cdba303238467d7cbee4c5aa99dda1aec319'
AND (
token = 'zYSR6/1dyQsOIGclqQjI+pd9z0eF1QsDskx5SMVlYeU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)