UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tNtBcNoL0xYCHrh1bOcz4qBS1/v7x0c9/OU8vO8d6I4='
WHERE
key_id = '5c67b32f653f8bca3a9553f71ebf0d63dfba3a6a15d65bb0ff349d32cd7ad701'
AND (
token = 'tNtBcNoL0xYCHrh1bOcz4qBS1/v7x0c9/OU8vO8d6I4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)