UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7m6X8DVgepk7L7rIjq/LlLZbWeTAImAsDhYZd9xxkNM='
WHERE
key_id = '7df2a4f8b8aad3b93fb499addde81fd162aed215314131c3df04b5113940896d'
AND (
token = '7m6X8DVgepk7L7rIjq/LlLZbWeTAImAsDhYZd9xxkNM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)