UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y/H7SfhJdmZ150cbKmbIikIiSVCpVHSsfnGz1y8+SQM='
WHERE
key_id = '544c479e297d2f6374dd1ac563a5090e6f6e7adc04031f813ece0a34b37ccb57'
AND (
token = 'Y/H7SfhJdmZ150cbKmbIikIiSVCpVHSsfnGz1y8+SQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)