UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mvAut/1tNUEAemyhvW/vYlNrBOzDG4IxIRdlAwpbc2E=' 
WHERE 
  key_id = '50a27654aecf70f1e95bdbe4c0e7a6d90b30a3ed129fac1e1eaba658a2e9e930' 
  AND (
    token = 'mvAut/1tNUEAemyhvW/vYlNrBOzDG4IxIRdlAwpbc2E=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030