UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '58yCFpkVbeRWg4WTNNLSj5KMS9gmiXt3DHFiCK4qG24=' 
WHERE 
  key_id = '4cb35e5ef3236c7aad60ced727c4917f1af41144e89e954b500b02bedeaac3eb' 
  AND (
    token = '58yCFpkVbeRWg4WTNNLSj5KMS9gmiXt3DHFiCK4qG24=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033