UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '89zvnHOeJMWC2NlWPhCEHyVdMzcoDWjU3XD/4JTmqDI=' 
WHERE 
  key_id = '1963bc74a1f41758ee393d046834e4824a34694401703f819af9fcc347b3c2bf' 
  AND (
    token = '89zvnHOeJMWC2NlWPhCEHyVdMzcoDWjU3XD/4JTmqDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034