UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c0QyzZ1ti+iaJsvCitkP9qNd82XISw23tjMFc3q0o/U='
WHERE
key_id = 'eda99b424a42b64fca1f9a95d34728b51baf6a0ad7fc322ffc01eeef3be966fa'
AND (
token = 'c0QyzZ1ti+iaJsvCitkP9qNd82XISw23tjMFc3q0o/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)