UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yivd3VkMqp0N8ye8CIpK1qPVM89O0JAInhtgqIlmAy0='
WHERE
key_id = '17e0d45a84925f952c3375d3650648b7f081ee5db364709dc95832ad1958c0a5'
AND (
token = 'yivd3VkMqp0N8ye8CIpK1qPVM89O0JAInhtgqIlmAy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)