UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KdtC3pGjMVpV2m5YkVuMQV1fWDz4PLp+Ao3S+vC1sf8=' 
WHERE 
  key_id = 'b0a81975c2a93f6e5ae226c3c02105239299d498910cef7a9c2ce81b891b9b49' 
  AND (
    token = 'KdtC3pGjMVpV2m5YkVuMQV1fWDz4PLp+Ao3S+vC1sf8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027