UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uKjYHR2dP568OlKNWO2JoyFyhhEpCQLeVyeWiGvD/WA=' 
WHERE 
  key_id = '00b158960fdc3d2b7f6b1e75eb91324325810a3e72be4bde8b228fa481aac628' 
  AND (
    token = 'uKjYHR2dP568OlKNWO2JoyFyhhEpCQLeVyeWiGvD/WA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017