UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '59w9AwtAhbvTMu/UqS4ci6BFtGfQUaYzo4zqJCb9DJE='
WHERE
key_id = '3636fa570ee2891b0cde78e1a70fe3b2775dc7efc0eea01f45ab35b4350566ea'
AND (
token = '59w9AwtAhbvTMu/UqS4ci6BFtGfQUaYzo4zqJCb9DJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)