UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yKYrqg3xZtwY3q9T2D7FjrKBHWEX5IFX0Y+3i4RWrsg='
WHERE
key_id = 'e07aecb0de6e7af92bf153ebcfbe1c3cc8efafb94f258a089492de1b2b06a937'
AND (
token = 'yKYrqg3xZtwY3q9T2D7FjrKBHWEX5IFX0Y+3i4RWrsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)