UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WXPGoaYvEQWt8kPcO7n/LWPBeJx/GZMy1trQP0E3g8Y='
WHERE
key_id = '90dd4dd64e64d9704e5e600c81c31bc2c54f6adc0d164f8c6558a8afa2a67fa8'
AND (
token = 'WXPGoaYvEQWt8kPcO7n/LWPBeJx/GZMy1trQP0E3g8Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)