UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fz1P8Cc3lehPjR+Juss44bbwuaqHIvOXKCAOXenFFCY='
WHERE
key_id = 'de1dfa90961fb15efb9c26984a0cf9a9bcf52217cf43db252a22adf1a40512a9'
AND (
token = 'fz1P8Cc3lehPjR+Juss44bbwuaqHIvOXKCAOXenFFCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)