UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UBqZdoLw5XQXk9C4WSxlBr0KM1Sjw+xIuhdBKOQjYzc=' 
WHERE 
  key_id = 'b115a8252cbce71ded4d643ddbe8908c8d4d97ca8eeca6ee63a1883f816c8efc' 
  AND (
    token = 'UBqZdoLw5XQXk9C4WSxlBr0KM1Sjw+xIuhdBKOQjYzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029