UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'y9FYU0S4LlOu6IEFiOlWMfp43yYqThTAb8hevU25dIc='
WHERE
key_id = 'f2385899ad30cca92bf12f540fc29aad1a39726b54da3cc415b2ef2405ad3a9c'
AND (
token = 'y9FYU0S4LlOu6IEFiOlWMfp43yYqThTAb8hevU25dIc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)