UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yokq8RJhkbS1GU2TSPHuqmFLDS/e2V75/khvF3O9yNI=' 
WHERE 
  key_id = '63da05e098b81095ae7ba17693a9554b753b5dcfdc0024c19a95b95999d36eed' 
  AND (
    token = 'Yokq8RJhkbS1GU2TSPHuqmFLDS/e2V75/khvF3O9yNI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050