UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/++yQ2GqZuS3YK7t8yBilCavnBs4H2z8ElnNO2Yz5QM=' 
WHERE 
  key_id = '98896e7a06c484bb6a31f0fce4bea830723d54574c8f1931546ae1b6feecec9b' 
  AND (
    token = '/++yQ2GqZuS3YK7t8yBilCavnBs4H2z8ElnNO2Yz5QM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023