UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z3voEuC6Q0mMb/ZdGPmWmrv7isO9dYAVMGkIsEuGOpw=' 
WHERE 
  key_id = 'fecc47e5d50585ccc0fa5530c34392f8f86eaed7ad27c571fd67ea3c518e8640' 
  AND (
    token = 'z3voEuC6Q0mMb/ZdGPmWmrv7isO9dYAVMGkIsEuGOpw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045