UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/TSqp9DccvM50HJUlZw9oL2osP7MlWY+2z4Cx7AJyeg=' 
WHERE 
  key_id = 'b9410f6a549f77b0dc62da8af51d7f611c6deaa134404e57268b29e8c7badf7f' 
  AND (
    token = '/TSqp9DccvM50HJUlZw9oL2osP7MlWY+2z4Cx7AJyeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031