UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T7t5unbvpSQw3GPSROKFjUfbO/cgywDSjX9WGXWrqyk=' 
WHERE 
  key_id = '807bcc0af67843107db0403ba0d668bf20c5251fe1a14150ad8472b5273c2116' 
  AND (
    token = 'T7t5unbvpSQw3GPSROKFjUfbO/cgywDSjX9WGXWrqyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017