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