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