UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6nQagLaI+z4wR1nLJSrYPWm5MKEcpLlyX0vxt+E7DQk='
WHERE
key_id = '6a851dab6a057fe37f7141a7fa2b6d7e1b86939481e075f715bd9ab75ae8ea68'
AND (
token = '6nQagLaI+z4wR1nLJSrYPWm5MKEcpLlyX0vxt+E7DQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)